package cards;

import java.awt.Image;
import java.io.IOException;

/**
 * 
 * @author akazero1
 * 
 */
public class Ace extends Card {
	/**
	 * Constructor for ace.
	 * 
	 * @param Value
	 * @param Suit
	 * @param Symbolrank
	 * @param Cardimage
	 * @throws IOException
	 */
	public Ace(int Value, String Suit, int Symbolrank, Image Cardimage)
			throws IOException {
		super(Value, Suit, Symbolrank, Cardimage);
	}

	/**
	 * Converts ace value to 1 from 11. Ensures: (ace)card.getValue() = 1;
	 */
	public void setAceValue() {
		value = 1;
	}

	/**
	 * Returns the value of the ace as 11
	 * 
	 * @return
	 */
	public int getSoftValue() {
		return super.getValue();
	}

	/**
	 * Returns the value of the ace as a 1
	 * 
	 * @return
	 */
	public int getHardValue() {
		setAceValue();
		return super.getValue();
	}

	@Override
	public String toString() {
		String cs = "";
		cs = (getName() + " of " + getSuit());
		return cs;
	}

	/**
	 * Returns the name of the ace as "Ace"
	 * 
	 * @return
	 */
	private String getName() {
		return "Ace";
	}

}
